<%--
  Created by IntelliJ IDEA.
  User: 星星在唱歌
  Date: 2022/3/1
  Time: 15:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>添加电子文档</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstarp/bootstrap.css">
    <script src="${pageContext.request.contextPath}/static/bootstarp/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script>
</head>
<body>
<script>
    function oo(){
        var title = $('#title');
        var date = $('#date');
        if (title.val()==''){
            alert("标题不能为空！");
            return false;
        }else if (date.val()==''){
            alert("日期不能为空！");
            return false;
        }
        return true;
    }
</script>
<div class="container">
    <h1>增加电子文档</h1>
    <br><br>
    <form class="form-horizontal" action="${pageContext.request.contextPath}/main?cmd=insert" method="post" onsubmit="return oo()">
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">文档名称:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" id="title" placeholder="文档名称" name="title">
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label" >文档摘要:</label>
            <div class="col-sm-6">
                <textarea class="form-control" name="summary"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">上传人:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" id="" placeholder="上传人" name="uploaduser">
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">上传时间:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" id="date" placeholder="上传时间" name="createdate">
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">文档类型:</label>
            <div class="col-sm-6">
                <select class="form-control input-sm" name="categoryId">
                    <option>==请选择==</option>
                    <c:forEach items="${ecList}" var="list">
                        <option value="${list.id}">${list.name}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-6">
                <input type="submit" class="btn btn-info " >
                <a href="${pageContext.request.contextPath}/main?cmd=main" class="btn btn-info">返回</a>
            </div>
        </div>
    </form>
    <h3 style="color: red">${insert}</h3>
</div>
</body>
</html>
